const exp = require('express'),
    bodyParser = require('body-parser'),
    cookieParser = require('cookie-parser'),
    app = exp()

app.use(exp.static('public'))
app.use(bodyParser.urlencoded({ extended: true }))
app.use(cookieParser())

// 使用router
app.use(require('./routes/user/register'))
app.use(require('./routes/user/signin'))
app.use(require('./routes/user/photo'))

app.use(require('./routes/index'))
app.use(require('./routes/ask'))
app.use(require('./routes/answer'))
app.use(require('./routes/ele'))
app.use(require('./routes/data'))

app.listen(3000, () => {
    console.log('服务器启动成功')
})